// Copyright (C) 2008 Taylor L. Riche <riche@cs.utexas.edu>
//  
// This program is free software; you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation; either version 2 of the License, or
// (at your option) any later version.
// 
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
// 
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software 
// Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
//
// $Id: NetDevice.cc 1081 2009-06-23 05:41:59Z djwhitebread $
//

#include "NetDevice.hh"

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

  void * 
  startNetDeviceClient(void * arg)
  {

    //  ** OLD TEMPLATE BASED CODE **	
    //  MethodWrapper<ProcElement> * mw = static_cast<MethodWrapper<ProcElement> *>(arg);
    //  ProcElement* obj = mw->object;
    //  void(ProcElement::*mthd)() = mw->method;
    //  delete mw;
    //  (obj->*mthd)();
    //  return NULL;
    //  ** OLD TEMPLATE BASED CODE **	

    requestDevices::NetDevice<BFT::util::CLIENT> * nic = static_cast<requestDevices::NetDevice<BFT::util::CLIENT> *>(arg);
    nic->process();
    return NULL;
  }

  void * 
  startNetDeviceOrder(void * arg)
  {

    //  ** OLD TEMPLATE BASED CODE **	
    //  MethodWrapper<ProcElement> * mw = static_cast<MethodWrapper<ProcElement> *>(arg);
    //  ProcElement* obj = mw->object;
    //  void(ProcElement::*mthd)() = mw->method;
    //  delete mw;
    //  (obj->*mthd)();
    //  return NULL;
    //  ** OLD TEMPLATE BASED CODE **	

    requestDevices::NetDevice<BFT::util::ORDER> * nic = static_cast<requestDevices::NetDevice<BFT::util::ORDER> *>(arg);
    nic->process();
    return NULL;
  }

  void * 
  startNetDeviceExec(void * arg)
  {

    //  ** OLD TEMPLATE BASED CODE **	
    //  MethodWrapper<ProcElement> * mw = static_cast<MethodWrapper<ProcElement> *>(arg);
    //  ProcElement* obj = mw->object;
    //  void(ProcElement::*mthd)() = mw->method;
    //  delete mw;
    //  (obj->*mthd)();
    //  return NULL;
    //  ** OLD TEMPLATE BASED CODE **	

    requestDevices::NetDevice<BFT::util::EXEC> * nic = static_cast<requestDevices::NetDevice<BFT::util::EXEC> *>(arg);
    nic->process();
    return NULL;
  }

#ifdef __cplusplus
}
#endif /* __cplusplus */
